package edu.xlh.travel.util;


import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

import java.util.HashMap;
import java.util.List;

public class AnnouncementDataFormatParsing {
    public static String fnParseData(List<JSONObject> dataList) {
        String title = null;
        if (dataList != null && dataList.size() > 0) {
            JSONObject firstJSONObject = dataList.get(0);
            //HashMap firstHashMap = JSON.toJavaObject(firstJSONObject,HashMap.class);
            //获取标题头
            String tag = (String)firstJSONObject.get("tag");
            if (tag.startsWith("h")) { //如果有标题
                List children = (List)firstJSONObject.get("children");
                String str = (String)children.get(0);
                title = str;
                return title;
            }
        }
        return "匿名标题";
    }
}
